package com.xqsr.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Swagger2配置信息
 *
 * @author 兴趣使然的L
 */
@Configuration
@EnableSwagger2
public class Swagger2Config {
    @Bean
    public Docket apiConfig(){

        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("API")
                .apiInfo(apiInfo())
                .select()
                .build();
    }

    private ApiInfo apiInfo(){

        return new ApiInfoBuilder()
                .title("gulimall-API文档")
                .description("本文档描述了微服务接口定义")
                .version("1.0")
                .build();
    }
}